-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Revert [Driver] Error for -gsplit-dwarf with RISC-V linker relaxation #169653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch reverts 80a4e6f After the relevant patches clang now supports dwarf fission with RISC-V linker relaxations, so we can remove the related driver error.
|
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: None (daniilavdeev) ChangesThis patch reverts 80a4e6f After the relevant patches clang now supports dwarf fission with RISC-V linker relaxations, so we can remove the related driver error. Full diff: https://github.com/llvm/llvm-project/pull/169653.diff 3 Files Affected:
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index f262db55a0d92..aeffe96e806bd 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -851,9 +851,6 @@ def warn_drv_sarif_format_unstable : Warning<
"diagnostic formatting in SARIF mode is currently unstable">,
InGroup<DiagGroup<"sarif-format-unstable">>;
-def err_drv_riscv_unsupported_with_linker_relaxation : Error<
- "%0 is unsupported with RISC-V linker relaxation (-mrelax)">;
-
def warn_drv_loongarch_conflicting_implied_val : Warning<
"ignoring '%0' as it conflicts with that implied by '%1' (%2)">,
InGroup<OptionIgnored>;
diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index 1dcce6d053a39..7fda8ea50223d 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -130,17 +130,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,
#undef RESERVE_REG
// -mrelax is default, unless -mno-relax is specified.
- if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) {
+ if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
Features.push_back("+relax");
- // -gsplit-dwarf -mrelax requires DW_AT_high_pc/DW_AT_ranges/... indexing
- // into .debug_addr, which is currently not implemented.
- Arg *A;
- if (getDebugFissionKind(D, Args, A) != DwarfFissionKind::None)
- D.Diag(clang::diag::err_drv_riscv_unsupported_with_linker_relaxation)
- << A->getAsString(Args);
- } else {
+ else
Features.push_back("-relax");
- }
// If -mstrict-align, -mno-strict-align, -mscalar-strict-align, or
// -mno-scalar-strict-align is passed, use it. Otherwise, the
diff --git a/clang/test/Driver/riscv-features.c b/clang/test/Driver/riscv-features.c
index 1c8b52bd31997..97736ff81c799 100644
--- a/clang/test/Driver/riscv-features.c
+++ b/clang/test/Driver/riscv-features.c
@@ -68,13 +68,6 @@
// DEFAULT-LINUX-SAME: "-target-feature" "+d"
// DEFAULT-LINUX-SAME: "-target-feature" "+c"
-// RUN: not %clang -c --target=riscv64-linux-gnu -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=ERR-SPLIT-DWARF
-// RUN: not %clang -c --target=riscv64 -gsplit-dwarf=single %s 2>&1 | FileCheck %s --check-prefix=ERR-SPLIT-DWARF
-// RUN: %clang -### -c --target=riscv64 -mno-relax -g -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=SPLIT-DWARF
-
-// ERR-SPLIT-DWARF: error: -gsplit-dwarf{{.*}} is unsupported with RISC-V linker relaxation (-mrelax)
-// SPLIT-DWARF: "-split-dwarf-file"
-
// RUN: %clang -mabi=lp64d --target=riscv64-unknown-fuchsia -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=FUCHSIA
// FUCHSIA: "-target-feature" "+m"
// FUCHSIA-SAME: "-target-feature" "+a"
|
|
@dwblaikie, @lenary, @MaskRay I’ve landed the dwarf-split related patches, so we can now remove the driver error. Any objections? |
|
@daniilavdeev please can you add notes to both clang's and LLVM's release notes about these changes. |
…llvm#169653) This patch reverts 80a4e6f After the relevant patches clang now supports dwarf fission with RISC-V linker relaxations, so we can remove the related driver error.
…llvm#169653) This patch reverts 80a4e6f After the relevant patches clang now supports dwarf fission with RISC-V linker relaxations, so we can remove the related driver error.
This patch reverts 80a4e6f
After the relevant patches clang now supports dwarf fission with RISC-V linker relaxations, so we can remove the related driver error.